Ansible Role: snapraid
=========

Installs and configures [snapraid](https://www.snapraid.it/).

Requirements
------------

No special requirements, but note that this role requires privilege escalation.

Role Variables
--------------

Available variables are listed below with their default values (see `defaults/main.yml`):

```yaml
snapraid_config_path: '/etc/snapraid.conf'
```

Configuration file for snapraid.

```yaml
snapraid_content_files:
  - '/var/snapraid.content'
```

List of stand-alone content files for snapraid. Content files on data and parity drives can be set in their respective variables.

```yaml
snapraid_data_drives: []
```

List of data drives for snapraid. Only `path` option is required for the drive path. Meanwhile, `content` option is optional and used to determine if content file will be written to the drive.

```yaml
snapraid_data_drives: []
```

List of parity drives for snapraid. Only `path` option is required for the drive path. Meanwhile, `content` option is optional and used to determine if content file will be written to the drive.

The following variables are not defined by default, but can be set manually :

```yaml
snapraid_excluded_files:
  - '/lost+found/'
  - '/tmp/'
```

List of excluded files for snapraid.

```yaml
snapraid_autosave: 100
```

Autosave value for snapraid.

Dependencies
------------

None.

Example Playbook
----------------

    - hosts: servers
      become: true
      vars_files:
        - vars/main.yml
      roles:
         - privatewright.snapraid

*Inside `vars/main.yml`*:

```yaml
snapraid_data_drives:
  - path: '/mnt/d1'
    content: true
snapraid_parity_drives:
  - path: '/mnt/p1'
    content: true
```

License
-------

GPL-3.0.

Author Information
------------------

This role was created in 2025 by privatewright.
